package com.jinlejia.feedback.question.http;

import androidx.annotation.IntRange;
import android.text.TextUtils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jinlejia.erp.base.MapCallBack;
import com.jinlejia.feedback.common.FbApiConfig;
import com.jinlejia.feedback.common.FbDataFilter;
import com.jinlejia.feedback.databinding.FbActivityQuestionDetailsBinding;
import com.jinlejia.feedback.question.adapter.question.KeyHelper;
import com.zhy.http.okhttp.OkHttpUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import okhttp3.Call;
import okhttp3.MediaType;

/**
 * 问题详情页的帮助类，主要是HTTP请求
 */

public final class QuestionDetailsHelper {
    private FbActivityQuestionDetailsBinding binding;

    public QuestionDetailsHelper(FbActivityQuestionDetailsBinding binding) {
        this.binding = binding;
    }

    public QuestionDetailsHelper() {
    }
    //region 一键总经理
    /**
     * 一键总经理
     */
    public void oneKeyGeneral(String problemCode,final OneKeyGeneralCallBack callback) {
        Map<String, String> map = new HashMap<>();
        map.put("problemCode",problemCode);
        OkHttpUtils.get()
                .url(FbApiConfig.OneKeyGeneral)
                .params(map)
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callback.onResult(false,"网络异常");
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        int code = FbDataFilter.code(response);
                        if (code==200){
                            callback.onResult(true,FbDataFilter.message(response));
                        }else {
                            callback.onResult(false,FbDataFilter.message(response));
                        }
                    }
                });
    }

    public interface OneKeyGeneralCallBack{
        void onResult(boolean flag,String message);
    }

    //endregion

    //region 问题详情

    /**
     * 问题详情
     *
     * @param problemCode 问题编码
     */
    public void getProblem(String problemCode, final GetProblemCallBack callBack) {
        OkHttpUtils.get()
                .url(FbApiConfig.GetProblem)
                .addParams("problemCode", problemCode)
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callBack.onError();
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        if (FbDataFilter.filter(response)) {
                            Map<String, Object> data = FbDataFilter.data(response);
                            ArrayList<Map<String, Object>> result = new ArrayList<>();
                            Map<String, Object> commonResult = new HashMap<>();
                            //region 标题
                            Map<String, Object> title = new HashMap<>();
                            title.put("type", "1");
                            title.put("problemCode",data.get("problemCode")); //问题编码
                            title.put("problemTitle", data.get("problemTitle")); //问题标题
                            title.put("askUserPortrait", getUserPortrait(String.valueOf(data.get("askUserPortrait")))); //提问人头像
                            title.put("askUserName", data.get("askUserName")); //提问人名称
                            title.put("askUserDept", data.get("askUserDept")); //提问人部门
                            title.put("askUserDuty", data.get("askUserDuty")); //提问人职务
                            title.put("problemContent", data.get("problemContent")); //问题内容
                            title.put("problemFirstLevel", data.get("problemFirstLevel"));//问题一级分类
                            title.put("problemSecondLevel", data.get("problemSecondLevel")); //问题二级分类
                            title.put("askTime", data.get("askTime")); //提问时间
                            title.put("likeCount", data.get("likeCount")); //点赞数
                            String likeStateStr = String.valueOf(data.get("likeState")); //点赞状态
                            if ("1".equals(likeStateStr)) { //已点赞
                                title.put("likeState", true);
                            } else { //未点赞
                                title.put("likeState", false);
                            }
                            title.put("collectCount", data.get("collectCount")); //关注数量
                            String collectStateStr = String.valueOf(data.get("collectState")); //关注状态int0未关注1已关注
                            if ("1".equals(collectStateStr)) { //已关注
                                title.put("collectState", true);
                            } else { //未关注
                                title.put("collectState", false);
                            }
                            //endregion

                            //region 解决方案
                            Map<String, Object> solution = new HashMap<>();
                            solution.put("problemManagePortrait", getUserPortrait(String.valueOf(data.get("problemManagePortrait")))); //问题负责人头像
                            solution.put("problemManageName", data.get("problemManageName")); //问题负责人名称
                            solution.put("problemManageDept", data.get("problemManageDept")); //问题负责人部门
                            solution.put("problemManageDuty", data.get("problemManageDuty")); //问题负责人职务
                            Map<String, Object> solutionTemp = null;
                            if (data.get("solution") != null) {
                                String solutionStr = String.valueOf(data.get("solution"));
                                solutionTemp = (Map<String, Object>) JSON.parse(solutionStr);
                                solution.put("solutionContent", solutionTemp.get("solutionContent")); //解决方案内容
                                solution.put("solutionCode",solutionTemp.get("solutionCode")); //解决方案编码
                                commonResult.put("solutionCode",solutionTemp.get("solutionCode")); //解决方案编码
                                solution.put("gmtModified",dateFormat(solutionTemp.get("gmtModified"))); //解决方案最后修改时间
                            }
                            if (solutionTemp != null && !TextUtils.isEmpty(String.valueOf(solutionTemp.get("solutionContent")))) {
                                solution.put("type",2);
                                result.add(title);
                                result.add(solution);
                            }else {
                                title.put(KeyHelper.LocalIsShowAll,true);
                                result.add(title);
                            }
                            //endregion

                            //region 最新进度 标题 和内容
                            List<Map<String,Object>> taskList = null;
                            if (solutionTemp!=null){
                                taskList = (List<Map<String, Object>>) solutionTemp.get("taskList");
                            }
                            Map<String, Object> progress;
                            Map<String, Object> progressTitle = new HashMap<>(); //最新进度 标题
                            //tempProgressList:
                            //用以缓存所有的跟进信息
                            ArrayList<Map<String, Object>> tempProgressList = new ArrayList<>();
                            if (taskList!=null){
                                for (int i = 0; i < taskList.size(); i++) {
                                    Map<String,Object> map = taskList.get(i);
                                    progress = new HashMap<>();
                                    progress.put("type",4);
                                    if (i==taskList.size()-1){
                                        progress.put(KeyHelper.LocalFollowIsLasted,true);
                                    }
                                    progress.put("taskCode",map.get("taskCode")); //任务编码
                                    progress.put("taskTitle",map.get("taskTitle")); //任务名称
                                    String state = String.valueOf(map.get("state"));
                                    progress.put("state",state); //任务状态
                                    String taskState = "";
                                    if ("0".equals(state)){
                                        taskState = "未开始";
                                    }else if ("1".equals(state)){
                                        taskState = "进行中";
                                    }else if ("2".equals(state)){
                                        taskState = "已完成";
                                    }

                                    progress.put("taskState",taskState);
                                    progress.put("estimatedStartTime",dateFormat(map.get("estimatedStartTime"))); //预计开始日期
                                    progress.put("estimatedEndTime",dateFormat(map.get("estimatedEndTime"))); //预计结束日期
                                    progress.put("assignUserName",map.get("assignUserName")); //任务负责人姓名
                                    progress.put("actualStartTime",timeFormat(map.get("actualStartTime"))); //实际开始时间
                                    progress.put("actualEndTime",timeFormat(map.get("actualEndTime"))); //实际结束时间
                                    String isShow = String.valueOf(map.get("isShow")); //是否展示全部跟进
                                    if ("1".equals(isShow)){
                                        progress.put("isShow",true);
                                    }else {
                                        progress.put("isShow",false);
                                    }
                                    String isOverdue = String.valueOf(map.get("isOverdue")); //是否逾期
                                    if ("1".equals(isOverdue)){
                                        progress.put("isOverdue",true);
                                    }else {
                                        progress.put("isOverdue",false);
                                    }

                                    Map<String,Object> taskFollow = (Map<String, Object>) map.get("taskFollow");
                                    if (taskFollow!=null){
                                        progress.put("followCode",taskFollow.get("followCode")); //跟进编码
                                        progress.put("followUserName",taskFollow.get("followUserName")); //跟进人名称
                                        progress.put("followContent",taskFollow.get("followContent")); //跟进内容
                                        progress.put("followTime",timeFormat(taskFollow.get("followTime"))); //跟进时间
                                    }

                                    String display = String.valueOf(map.get("display")); //是否是最新进度,
                                                                                         // 折叠时用以显示的数据
                                    if ("1".equals(display)){
                                        progressTitle.put("type",3);
                                        progressTitle.put("taskCode",map.get("taskCode")); //任务编码
                                        progressTitle.put("taskTitle",map.get("taskTitle")); //任务名称
                                        progressTitle.put("taskState",taskState);
                                        result.add(progressTitle);
                                    }
                                    tempProgressList.add(progress);
                                }
                                if (progressTitle.isEmpty() && tempProgressList.size()>0){ //如果没有标题数据，
                                                                                // 则用数据中的第一行进行展示为标题
                                    Map<String, Object> map = tempProgressList.get(0);
                                    Map<String,Object> titleMap = new HashMap<>(map);
                                    titleMap.put("type",3);
                                    result.add(titleMap);
                                }
                            }
                            if (!tempProgressList.isEmpty()){
                                result.addAll(tempProgressList);
                            }
                            //endregion

                            //region 问题回复
                            List<Map<String,Object>> replyList = (List<Map<String, Object>>) data.get("replyList");
                            Map<String,Object> reply;
                            for (int i = 0; i < replyList.size(); i++) {
                                Map<String,Object> map = replyList.get(i);
                                reply = new HashMap<>();
                                if (i==0){
                                    reply.put(KeyHelper.LocalReplyIsFirst,true);
                                    reply.put(KeyHelper.LocalReplyIsLasted,false);
                                }else if (i==replyList.size()-1){
                                    reply.put(KeyHelper.LocalReplyIsFirst,false);
                                    reply.put(KeyHelper.LocalReplyIsLasted,true);
                                }
                                reply.put("replyCode",map.get("replyCode")); //回复编码
                                reply.put("replyUserId",map.get("replyUserId")); //回复人Id
                                reply.put("replyUserPortrait",getUserPortrait(String.valueOf(map.get("replyUserPortrait")))); //回复人头像
                                reply.put("replyUserName",map.get("replyUserName")); //回复人姓名
                                reply.put("replyUserDept",map.get("replyUserDept")); //回复人部门
                                reply.put("replyUserDuty",map.get("replyUserDuty")); //回复人职务
                                reply.put("replyContent",map.get("replyContent")); //回复内容
                                reply.put("replyTime",timeFormat(map.get("replyTime"))); //回复时间
                                reply.put("replyCommentCount",map.get("replyCommentCount")); //回复里的评论个数
                                String isTop = String.valueOf(map.get("isTop"));
                                if ("1".equals(isTop)){
                                    reply.put("isTop",true);
                                }else {
                                    reply.put("isTop",false);
                                }
                                reply.put("replyLikeCount", map.get("likeCount")); //点赞数
                                String replyLikeStateStr = String.valueOf(map.get("likeState")); //点赞状态
                                if ("1".equals(replyLikeStateStr)) { //已点赞
                                    reply.put("replyLikeState", true);
                                } else { //未点赞
                                    reply.put("replyLikeState", false);
                                }
                                reply.put("type",5);
                                result.add(reply);
                            }
                            //endregion

                            //region 按钮状态

                            commonResult.put("problemCode", data.get("problemCode")); //问题编码
                            String isGeneralStr = String.valueOf(data.get("isGeneral"));//是否一键总经理
                            if ("1".equals(isGeneralStr)) {
                                commonResult.put("isGeneral", true);
                            } else {
                                commonResult.put("isGeneral", false);
                            }
                            commonResult.put("showButton",data.get("showButton"));
                            //endregion
                            callBack.onResult(commonResult, result);
                        } else {
                            if (FbDataFilter.code(response) == 501) {
                                callBack.onEmpty();
                            }
                        }

                    }
                });
    }
    private String timeFormat(Object time){
        String timeStr = String.valueOf(time);
        if ("null".equalsIgnoreCase(timeStr)){
            return "";
        }
        return timeStr;
    }

    private String getUserPortrait(String portrait){
        return FbApiConfig.HEADER_URL + portrait;
    }

    private String dateFormat(Object date){
        String dateStr = String.valueOf(date);
        if ("null".equalsIgnoreCase(dateStr)){
            return "";
        }
        return dateStr;
    }


    public interface GetProblemCallBack {
        void onResult(Map<String, Object> result, ArrayList<Map<String, Object>> data);

        void onEmpty();

        void onError();
    }
    //endregion

    //region 问题回复列表
    public void listReply(final ArrayList<Map<String, Object>> tempData, final int pageIndex, String problemCode, final ListReplyCallBack callBack){
        JSONObject json = new JSONObject();
        json.put("problemCode",problemCode);
        json.put("pageSize",20);
        json.put("pageIndex",pageIndex);
        OkHttpUtils.postString()
                .url(FbApiConfig.ListReply)
                .mediaType(MediaType.parse("application/json; charset=utf-8"))
                .content(json.toString())
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callBack.onError();
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        if (FbDataFilter.code(response) == 303){
                            callBack.onNoMore();
                            return;
                        }
                        JSONArray data = FbDataFilter.dataArray(response);
                        ArrayList<Map<String, Object>> result = new ArrayList<>();
                        Map<String,Object> reply;
                        for (int i = 0; i < data.size(); i++) {
                            Map<String,Object> map = data.getJSONObject(i);
                            reply = new HashMap<>();
                            if (i==0){
                                reply.put(KeyHelper.LocalReplyIsFirst,true);
                                reply.put(KeyHelper.LocalReplyIsLasted,false);
                            }else if (i==data.size()-1){
                                reply.put(KeyHelper.LocalReplyIsFirst,false);
                                reply.put(KeyHelper.LocalReplyIsLasted,true);
                            }
                            reply.put("replyCode",map.get("replyCode")); //回复编码
                            reply.put("replyUserPortrait",getUserPortrait(String.valueOf(map.get("replyUserPortrait")))); //回复人头像
                            reply.put("replyUserName",map.get("replyUserName")); //回复人姓名
                            reply.put("replyUserDept",map.get("replyUserDept")); //回复人部门
                            reply.put("replyUserDuty",map.get("replyUserDuty")); //回复人职务
                            reply.put("replyContent",map.get("replyContent")); //回复内容
                            reply.put("replyTime",timeFormat(map.get("replyTime"))); //回复时间
                            reply.put("replyCommentCount",map.get("replyCommentCount")); //回复里的评论个数
                            String isTop = String.valueOf(map.get("isTop"));
                            if ("1".equals(isTop)){
                                reply.put("isTop",true);
                            }else {
                                reply.put("isTop",false);
                            }
                            reply.put("replyLikeCount", map.get("likeCount")); //点赞数
                            String replyLikeStateStr = String.valueOf(map.get("likeState")); //点赞状态
                            if ("1".equals(replyLikeStateStr)) { //已点赞
                                reply.put("replyLikeState", true);
                            } else { //未点赞
                                reply.put("replyLikeState", false);
                            }
                            reply.put("type",5);
                            result.add(reply);
                        }
                        if (pageIndex==1 && tempData!=null){
                            Iterator<Map<String, Object>> iterator = tempData.iterator();
                            while (iterator.hasNext()){
                                Map<String, Object> map = iterator.next();
                                if ("5".equals(String.valueOf(map.get("type")))){
                                    iterator.remove();
                                }
                            }
                            tempData.addAll(result);
                            callBack.onResult(tempData,result.size());
                        }else {
                            callBack.onResult(result,result.size());
                        }
                    }
                });
    }

    public interface ListReplyCallBack{
        void onResult(ArrayList<Map<String, Object>> result,int resultSize);
        void onNoMore();
        void onError();
    }
    //endregion

    //region 解决方案
    public void confirmSolution(String solutionCode, final ConfirmSolutionCallback callback){
        OkHttpUtils.get()
                .url(FbApiConfig.ConfirmSolution)
                .addParams("solutionCode",solutionCode)
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callback.onResult(false,"网络异常",null);
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        int code = FbDataFilter.code(response);
                        if (code==200){
                            Map<String, Object> data = FbDataFilter.data(response);
                            String buttonState = String.valueOf(data.get("showButton"));
                            String message = FbDataFilter.message(response);
                            callback.onResult(true,message,buttonState);
                        }else {
                            callback.onResult(false,FbDataFilter.message(response),null);
                        }
                    }
                });
    }

    public interface ConfirmSolutionCallback{
        void onResult(boolean result,String message,String buttonState);
    }
    //endregion

    //region 问题确认解决
    public void confirmSettle(String problemCode, final ConfirmSettleCallback callback){
        OkHttpUtils.get()
                .addParams("problemCode",problemCode)
                .url(FbApiConfig.ConfirmSettle)
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callback.onResult(false,"网络异常",null);
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        int code = FbDataFilter.code(response);
                        if (code==200){
                            Map<String, Object> data = FbDataFilter.data(response);
                            String buttonState = String.valueOf(data.get("showButton"));
                            String message = FbDataFilter.message(response);
                            callback.onResult(true,message,buttonState);
                        }else {
                            callback.onResult(false,FbDataFilter.message(response),null);
                        }
                    }
                });
    }
    public interface ConfirmSettleCallback{
        void onResult(boolean result,String message,String showButtonState);
    }
    //endregion

    //region 添加评价

    /**
     *
     * @param problemCode 问题编码
     * @param satisfaction 满意度int 0非常不满意 1不满意 2一般 3满意 4非常满意
     * @param evaluateContent 评价内容
     */
    public void addEvaluate(String problemCode,@IntRange(from = 0,to = 4) int satisfaction,
                            String evaluateContent,final AddEvaluateCallBack callback){
        JSONObject json = new JSONObject();
        json.put("problemCode",problemCode);
        json.put("satisfaction",satisfaction);
        json.put("evaluateContent",evaluateContent);
        OkHttpUtils.postString()
                .url(FbApiConfig.AddEvaluate)
                .mediaType(MediaType.parse("application/json; charset=utf-8"))
                .content(json.toString())
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callback.onResult(false,"网络异常",null);
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        int code = FbDataFilter.code(response);
                        if (code==200){
                            Map<String, Object> data = FbDataFilter.data(response);
                            String showButton = String.valueOf(data.get("showButton"));
                            String message = FbDataFilter.message(response);
                            callback.onResult(true,message,showButton);
                        }else {
                            callback.onResult(false,FbDataFilter.message(response),null);
                        }
                    }
                });
    }

    public interface AddEvaluateCallBack{
        void onResult(boolean result,String message,String buttonState);
    }
    //endregion

    //region 点赞收藏
    //点赞操作
    public void likeOperation(boolean currentState,String likeCode,LikeType likeType,LikeOrCollectCallBack callBack){
        likeOrCollect(currentState,null,likeCode, LikeOrCollectType.Like,likeType,callBack);
    }
    //收藏操作
    public void collectOperation(boolean currentState,String problemCode,LikeType likeType,LikeOrCollectCallBack callBack){
        likeOrCollect(currentState,problemCode,null, LikeOrCollectType.Collect,likeType,callBack);
    }
    //点赞或者收藏操作
    private void likeOrCollect(boolean currentState,String problemCode, String likeCode, final LikeOrCollectType state, final LikeType likeType, final LikeOrCollectCallBack callBack){
        JSONObject json = new JSONObject();
        if (problemCode!=null){
            json.put("problemCode",problemCode);
        }
        json.put("likeOrCollect",state.getValue()); //点赞关注类型
        json.put("likeCode",likeCode);//点赞类型编码
        if (likeType!=null){
            json.put("likeType",likeType.getValue());//点赞类型
        }
        if (currentState){ //点赞收藏当前状态
            json.put("currentState",1);//已点赞或已收藏
        }else {
            json.put("currentState",0);//未点赞或未收藏
        }
        OkHttpUtils.postString()
                .url(FbApiConfig.LikeOrCollect)
                .content(json.toString())
                .mediaType(MediaType.parse("application/json; charset=utf-8"))
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callBack.onFailed("网络异常");
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        if (FbDataFilter.code(response)==200){
                            Map<String, Object> data = FbDataFilter.data(response);
                            LikeOrCollectType type =  LikeOrCollectType.format(String.valueOf(data.get("likeOrCollect")));
                            String stateStr = String.valueOf(data.get("state"));
                            int count = 0;
                            try{
                                count = Integer.parseInt(String.valueOf(data.get("count")));
                            }catch (Exception ignored){

                            }
                            if ("1".equals(stateStr)){
                                callBack.onSuccess(type,likeType,true,count);
                            }else {
                                callBack.onSuccess(type,likeType,false,count);
                            }
                        }else {
                            String message = FbDataFilter.message(response);
                            callBack.onFailed(message);
                        }
                    }
                });
    }
    //点赞关注类型
    public enum LikeOrCollectType {
        Like(0),
        Collect(1);

        private int value;
        LikeOrCollectType(int i) {
            this.value = i;
        }

        public int getValue() {
            return value;
        }

        public static LikeOrCollectType format(String type){
            if ("1".equals(type)){
                return Collect;
            }else {
                return Like;
            }
        }
    }

    public enum LikeType{
        Question(0),
        Reply(1),
        Comment(2)
        ;
        private int value;
        LikeType(int i) {
            this.value = i;
        }

        public int getValue() {
            return value;
        }
    }

    public interface LikeOrCollectCallBack{
        void onSuccess(LikeOrCollectType likeOrCollect, LikeType likeType, boolean state, int count);
        void onFailed(String message);
    }
    //endregion

    //region 添加回复
    public void saveReply(String problemCode, String replyContent, final SaveReplyCallBack callBack){
        JSONObject json = new JSONObject();
        json.put("problemCode",problemCode);
        json.put("replyContent",replyContent);
        OkHttpUtils.postString()
                .mediaType(MediaType.parse("application/json; charset=utf-8"))
                .url(FbApiConfig.SaveReply)
                .content(json.toString())
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callBack.onResult(false,"网络异常");
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        if (FbDataFilter.code(response) == 200){
                            callBack.onResult(true,FbDataFilter.message(response));
                        }else {
                            String message = FbDataFilter.message(response);
                            callBack.onResult(false,message);
                        }
                    }
                });
    }

    public interface SaveReplyCallBack{
        void onResult(boolean flag,String message);
    }
    //endregion

    //region 添加评论
    public void saveReplyComment(String problemCode, String replyCode, String commentTargetUserId,
                                 String commentTargetUserName, String commentContent, final SaveReplyCommentCallBack callBack){
        JSONObject json = new JSONObject();
        json.put("problemCode",problemCode);
        json.put("replyCode",replyCode);
        json.put("commentTargetUserId",commentTargetUserId);
        json.put("commentTargetUserName",commentTargetUserName);
        json.put("commentContent",commentContent);
        OkHttpUtils.postString()
                .mediaType(MediaType.parse("application/json; charset=utf-8"))
                .content(json.toString())
                .url(FbApiConfig.SaveReplyComment)
                .build()
                .execute(new MapCallBack() {
                    @Override
                    public void onError(Call call, Exception e, int id) {
                        callBack.onResult(false,"网络异常");
                    }

                    @Override
                    public void onResponse(Map<String, Object> response, int id) {
                        int code = FbDataFilter.code(response);
                        if (code==200){
                            String message = FbDataFilter.message(response);
                            callBack.onResult(true,message);
                        }else {
                            String message = FbDataFilter.message(response);
                            callBack.onResult(false,message);
                        }

                    }
                });
    }

    public interface SaveReplyCommentCallBack{
        void onResult(boolean flag,String message);
    }
    //endregion
}
